home *** CD-ROM | disk | FTP | other *** search
/ Freelog 121 / FreelogMagazineJuilletAout2014-No121.iso / Outils / Adobe-Air / adobe-air_13.exe / [0] / setup.swf / scripts / skins / SimpleScrollThumbSkin.as < prev    next >
Text File  |  2014-03-27  |  2KB  |  62 lines

  1. package skins
  2. {
  3.    import flash.display.DisplayObject;
  4.    import mx.core.UIComponent;
  5.    
  6.    public class SimpleScrollThumbSkin extends UIComponent
  7.    {
  8.        
  9.       
  10.       private var thumbIcon:DisplayObject;
  11.       
  12.       public function SimpleScrollThumbSkin()
  13.       {
  14.          super();
  15.       }
  16.       
  17.       override public function get measuredWidth() : Number
  18.       {
  19.          return 16;
  20.       }
  21.       
  22.       override protected function updateDisplayList(param1:Number, param2:Number) : void
  23.       {
  24.          super.updateDisplayList(param1,param2);
  25.          var _loc3_:uint = getStyle("thumbBorderColor");
  26.          var _loc4_:uint = getStyle("thumbFillColor");
  27.          var _loc5_:uint = getStyle("thumbOverFillColor");
  28.          graphics.clear();
  29.          switch(name)
  30.          {
  31.             case "thumbUpSkin":
  32.             default:
  33.                drawRoundRect(1,1,param1 - 1,param2 - 1,0,_loc3_,1);
  34.                drawRoundRect(2,2,param1 - 3,param2 - 3,0,_loc4_,1);
  35.                break;
  36.             case "thumbOverSkin":
  37.             case "thumbDownSkin":
  38.                drawRoundRect(1,1,param1 - 1,param2 - 1,0,_loc3_,1);
  39.                drawRoundRect(2,2,param1 - 3,param2 - 3,0,_loc5_,1);
  40.          }
  41.          this.thumbIcon.x = (param1 - this.thumbIcon.width) / 2;
  42.          this.thumbIcon.y = (param2 - this.thumbIcon.height) / 2;
  43.       }
  44.       
  45.       override protected function createChildren() : void
  46.       {
  47.          var _loc1_:Class = null;
  48.          if(!this.thumbIcon)
  49.          {
  50.             _loc1_ = getStyle("scrollThumbIcon");
  51.             this.thumbIcon = new _loc1_();
  52.             addChild(this.thumbIcon);
  53.          }
  54.       }
  55.       
  56.       override public function get measuredHeight() : Number
  57.       {
  58.          return 10;
  59.       }
  60.    }
  61. }
  62.